package server;

import client.MapleCharacter;
import handling.world.party.MaplePartyCharacter;
import java.lang.ref.WeakReference;

public class MapleCarnivalChallenge {

    WeakReference<MapleCharacter> challenger;
    String challengeinfo = "";

    public MapleCarnivalChallenge(MapleCharacter challenger) {
        this.challenger = new WeakReference(challenger);
        this.challengeinfo += "#b";
        for (MaplePartyCharacter pc : challenger.getParty().getMembers()) {
            MapleCharacter c = challenger.getMap().getCharacterById(pc.getId());
            if (c != null) {
                this.challengeinfo = (this.challengeinfo + c.getName() + " / Level" + c.getLevel() + " / " + getJobNameById(c.getJob()));
            }
        }
        this.challengeinfo += "#k";
    }

    public MapleCharacter getChallenger() {
        return (MapleCharacter) this.challenger.get();
    }

    public String getChallengeInfo() {
        return this.challengeinfo;
    }

    public static String getJobNameById(int job) {
        switch (job) {
            case 0:
            case 1:
                return "新手";
            case 1000:
                return "初心者";
            case 2000:
                return "战童";
            case 2001:
                return "小不点";
            case 3000:
                return "预备兵";
            case 100:
                return "战士";
            case 110:
                return "剑客";
            case 111:
                return "勇士";
            case 112:
                return "勇士";
            case 120:
                return "准骑士";
            case 121:
                return "骑士";
            case 122:
                return "骑士";
            case 130:
                return "枪战士";
            case 131:
                return "龙骑士";
            case 132:
                return "龙骑士";
            case 200:
                return "魔法师";
            case 210:
                return "火毒法师";
            case 211:
                return "火毒巫师";
            case 212:
                return "火毒巫师";
            case 220:
                return "冰雷法师";
            case 221:
                return "冰雷巫师";
            case 222:
                return "冰雷巫师";
            case 230:
                return "牧师";
            case 231:
                return "祭司";
            case 232:
                return "祭司";
            case 300:
                return "弓箭手";
            case 310:
                return "猎人";
            case 311:
                return "射手";
            case 312:
                return "射手";
            case 320:
                return "弩弓手";
            case 321:
                return "游侠";
            case 322:
                return "游侠";
            case 400:
                return "飞侠";
            case 410:
                return "刺客";
            case 411:
                return "无影人";
            case 412:
                return "无影人";
            case 420:
                return "侠客";
            case 421:
                return "独行客";
            case 422:
                return "独行客";
            case 430:
                return "见习刀客";
            case 431:
                return "双刀客";
            case 432:
                return "双刀侠";
            case 433:
                return "血刀";
            case 434:
                return "暗影双刀";
            case 500:
                return "海盗";
            case 510:
                return "拳手";
            case 511:
                return "斗士";
            case 512:
                return "冲锋队长";
            case 520:
                return "火枪手";
            case 521:
                return "大副";
            case 522:
                return "船长";
            case 501:
                return "海盗炮手";
            case 530:
                return "火炮手";
            case 531:
                return "毁灭炮手";
            case 532:
                return "神炮王";
            case 508:
            case 570:
            case 571:
            case 572:
                return "龙的传人";
            case 1100:
            case 1110:
            case 1111:
            case 1112:
                return "魂骑士";
            case 1200:
            case 1210:
            case 1211:
            case 1212:
                return "炎术士";
            case 1300:
            case 1310:
            case 1311:
            case 1312:
                return "风灵使者";
            case 1400:
            case 1410:
            case 1411:
            case 1412:
                return "夜行者";
            case 1500:
            case 1510:
            case 1511:
            case 1512:
                return "奇袭者";
            case 2100:
            case 2110:
            case 2111:
            case 2112:
                return "战神";
            case 2200:
            case 2210:
            case 2211:
            case 2212:
            case 2213:
            case 2214:
            case 2215:
            case 2216:
            case 2217:
            case 2218:
                return "龙神";
            case 2002:
            case 2300:
            case 2310:
            case 2311:
            case 2312:
                return "双弩精灵";
            case 2003:
            case 2400:
            case 2410:
            case 2411:
            case 2412:
                return "幻影";
            case 2004:
            case 2700:
            case 2710:
            case 2711:
            case 2712:
                return "夜光法师";
            case 3001:
            case 3100:
            case 3110:
            case 3111:
            case 3112:
                return "恶魔猎手";
            case 3101:
            case 3120:
            case 3121:
            case 3122:
                return "恶魔复仇者";
            case 3200:
            case 3210:
            case 3211:
            case 3212:
                return "幻灵斗师";
            case 3300:
            case 3310:
            case 3311:
            case 3312:
                return "弩豹游侠";
            case 3500:
            case 3510:
            case 3511:
            case 3512:
                return "机械师";
            case 5000:
                return "无名少年";
            case 5100:
            case 5110:
            case 5111:
            case 5112:
                return "米哈尔";
            case 6000:
            case 6100:
            case 6110:
            case 6111:
            case 6112:
                return "狂龙战士";
            case 6001:
            case 6500:
            case 6510:
            case 6511:
            case 6512:
                return "爆莉萌天使";
            case 3002:
            case 3600:
            case 3610:
            case 3611:
            case 3612:
                return "尖兵";
            case 10000:
            case 10100:
            case 10110:
            case 10111:
            case 10112:
                return "神之子";
            case 11000:
            case 11200:
            case 11210:
            case 11211:
            case 11212:
                return "林之灵";
            case 2005:
            case 2500:
            case 2510:
            case 2511:
            case 2512:
                return "隐月";
            case 900:
                return "管理员";
            case 910:
                return "超级管理员";
            case 800:
                return "管理者";
        }
        return "";
    }

    public static String getJobBasicNameById(int job) {
        switch (job) {
            case 100:
            case 110:
            case 111:
            case 112:
            case 120:
            case 121:
            case 122:
            case 130:
            case 131:
            case 132:
            case 1100:
            case 1110:
            case 1111:
            case 1112:
            case 2100:
            case 2110:
            case 2111:
            case 2112:
            case 3100:
            case 3101:
            case 3110:
            case 3111:
            case 3112:
            case 3120:
            case 3121:
            case 3122:
            case 3600:
            case 3610:
            case 3611:
            case 3612:
            case 5100:
            case 5110:
            case 5111:
            case 5112:
            case 6100:
            case 6110:
            case 6111:
            case 6112:
            case 10100:
            case 10110:
            case 10111:
            case 10112:
                return "战士";
            case 200:
            case 210:
            case 211:
            case 212:
            case 220:
            case 221:
            case 222:
            case 230:
            case 231:
            case 232:
            case 1200:
            case 1210:
            case 1211:
            case 1212:
            case 2200:
            case 2210:
            case 2211:
            case 2212:
            case 2213:
            case 2214:
            case 2215:
            case 2216:
            case 2217:
            case 2218:
            case 2700:
            case 2710:
            case 2711:
            case 2712:
            case 3200:
            case 3210:
            case 3211:
            case 3212:
            case 11200:
            case 11210:
            case 11211:
            case 11212:
                return "魔法师";
            case 300:
            case 310:
            case 311:
            case 312:
            case 320:
            case 321:
            case 322:
            case 1300:
            case 1310:
            case 1311:
            case 1312:
            case 2300:
            case 2310:
            case 2311:
            case 2312:
            case 3300:
            case 3310:
            case 3311:
            case 3312:
                return "射手";
            case 400:
            case 410:
            case 411:
            case 412:
            case 420:
            case 421:
            case 422:
            case 430:
            case 431:
            case 432:
            case 433:
            case 434:
            case 1400:
            case 1410:
            case 1411:
            case 1412:
                return "飞侠";
            case 500:
            case 501:
            case 508:
            case 509:
            case 510:
            case 511:
            case 512:
            case 520:
            case 521:
            case 522:
            case 530:
            case 531:
            case 532:
            case 570:
            case 571:
            case 572:
            case 580:
            case 581:
            case 582:
            case 590:
            case 591:
            case 592:
            case 1500:
            case 1510:
            case 1511:
            case 1512:
            case 3500:
            case 3510:
            case 3511:
            case 3512:
            case 6500:
            case 6510:
            case 6511:
            case 6512:
                return "海盗";
        }
        return "";
    }

    public static String getJobNameByIdNull(int job) {
        switch (job) {
            case 0:
            case 1:
                return "新手";
            case 1000:
                return "初心者";
            case 2000:
                return "战童";
            case 2001:
                return "小不点";
            case 3000:
                return "预备兵";
            case 100:
                return "战士";
            case 110:
                return "剑客";
            case 111:
                return "勇士";
            case 112:
                return "勇士";
            case 120:
                return "准骑士";
            case 121:
                return "骑士";
            case 122:
                return "骑士";
            case 130:
                return "枪战士";
            case 131:
                return "龙骑士";
            case 132:
                return "龙骑士";
            case 200:
                return "魔法师";
            case 210:
                return "火毒法师";
            case 211:
                return "火毒巫师";
            case 212:
                return "火毒巫师";
            case 220:
                return "冰雷法师";
            case 221:
                return "冰雷巫师";
            case 222:
                return "冰雷巫师";
            case 230:
                return "牧师";
            case 231:
                return "祭司";
            case 232:
                return "祭司";
            case 300:
                return "弓箭手";
            case 310:
                return "猎人";
            case 311:
                return "射手";
            case 312:
                return "射手";
            case 320:
                return "弩弓手";
            case 321:
                return "游侠";
            case 322:
                return "游侠";
            case 400:
                return "飞侠";
            case 410:
                return "刺客";
            case 411:
                return "无影人";
            case 412:
                return "无影人";
            case 420:
                return "侠客";
            case 421:
                return "独行客";
            case 422:
                return "独行客";
            case 900:
                return "管理员";
            case 910:
                return "超级管理员";
            case 800:
                return "管理者";
        }
        return null;
    }
}
